/**
 * @file    sample.h
 * @brief   采样模块
 * @author  Liuwei
 * @version 1.0.1
 * @date    2023-04-26
 * 
 * @copyright Copyright (c) 2023 JBD-Energy Storage Technology Co. LTD
 * 
 * @par 修改日志:
 * <table>
 * <tr><th>Date       <th>Version   <th>Author   <th>Description
 * <tr><td>2023-04-26 <td>1.0.1     <td>Liuwei   <td>首次创建
 * </table>
 */

#ifndef __SAMPLE_H_
#define __SAMPLE_H_

/* file includes -------------------------------------------------------------*/
#include <stdint.h>
/* cplusplus -----------------------------------------------------------------*/
#ifdef __cplusplus
extern "C" {
#endif

/* macro/define/typedef ------------------------------------------------------*/
#define NTC_PULL_UP_RES         (10000)   /* 10K*/
#define INVALID_TEMP            (-410)
/* variables -----------------------------------------------------------------*/

/*******************************************************************************
 * public API List
 ******************************************************************************/
void sample_init(void);
void sample_volt(void);
void sample_temp(void);
void sample_afe_deal(uint16_t cycle);
void sample_curr(uint16_t cycle);
void sample_fault_clear(uint32_t cycle);
void sample_balance_ctrl(void);
void sample_hard_ver(void);
void sample_clr_sc_prp(void);
uint8_t sample_set_sc_clr_state(void);
void sample_calib_zero(void);
void sample_calib_chg(uint16_t set_val);
void sample_calib_dsg(uint16_t set_val);
void sample_calib_cvolt(uint8_t cell_id , uint16_t set_val);
void sample_afe_deal_sleep(uint16_t cycle);
void sample_restart_prechg(void);
//uint8_t sample_calc_temp_num(void);
float sample_get_curr(void);

#ifdef __cplusplus
}
#endif

#endif  /* #ifndef __SAMPLE_H_ */
/********** Copyright (c) 2023 JBD-Energy Storage Technology Co. LTD *********/
